package com.itheima.mall.service;

import com.itheima.mall.client.DemoClient;
import com.itheima.mall.exception.BusinessException;
import com.itheima.mall.exception.ErrorResult;
import com.itheima.mall.pojo.Demo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminDemoService {

    @Autowired
    private DemoClient demoClient;

    /**
     * demo
     */
    public Demo getDemo(String name, Long age) {
        //模拟异常
//        if (true) throw new BusinessException(ErrorResult.error());
        return demoClient.getDemo(name, age);
    }


}
